package com.service;

import com.dao.EmployeeDao;
import com.entity.Employee;
import lombok.Data;

@Data
public class EmployeeServiceImpl implements EmployeeService {
    private EmployeeDao employeeDao;  // 依赖接口

    @Override
    public Employee selectEmployeeById(int id) {
        Employee employee = employeeDao.selectEmployeeById(id);
        return employee;
    }

    @Override
    public Boolean insertEmployee(Employee employee) {
        int i = employeeDao.insertEmployee(employee);
        return i > 0;
    }

    @Override
    public Boolean deleteEmployeeById(int id) {
        int i = employeeDao.deleteEmployeeById(id);
        return i > 0;
    }

    @Override
    public Boolean updateEmployeeById(Employee employee) {
        int i = employeeDao.updateEmployeeById(employee);
        return i > 0;
    }

}
